package org.helgoboss.clc_installer_extension;

import org.helgoboss.win32_facade.Win32Facade;
import org.helgoboss.win32_facade.PathScope;

import com.izforge.izpack.event.SimpleInstallerListener;
import com.izforge.izpack.installer.AutomatedInstallData;
import com.izforge.izpack.util.AbstractUIProgressHandler;
import com.izforge.izpack.util.Librarian;
import com.izforge.izpack.util.NativeLibraryClient;


public class ClcInstallerExtension extends SimpleInstallerListener implements NativeLibraryClient {
	
	@Override
    public void afterPacks(AutomatedInstallData idata, AbstractUIProgressHandler handler) {
		try {
			Librarian.getInstance().loadLibrary("jnidispatch", this);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
        Win32Facade.addToPathVariable(PathScope.GLOBAL, idata.getInstallPath() + "\\bin");
    }

	public void freeLibrary(String name) {
	}
}
